package com.lanqiao.companymanage.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
public class User {
    @TableId(type = IdType.AUTO)
    private Integer id;
    //用户名
    private String username;
    //密码
    private String password;
    //职工编号
    private Integer userId;
    //性别
    private String sex;
    //加入时间
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date jointime;
    //基本工资
    private Double salary;
    //工龄
    private Double gongning;
    //职位
    private Double employ;
    //补贴
    private Double butie;
    //合计1
    private Double salarysum;
    // 所在部门
    @TableField(exist = false)
    private Dep dep;

    public User(Integer id, String username, String password, Integer userId, String sex, Date jointime) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.userId = userId;
        this.sex = sex;
        this.jointime = jointime;
    }
}
